\documentclass[titlepage]{article}

\usepackage{tabularx}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage[pdfborder={0 0 0}]{hyperref}

\graphicspath{{./objectDiagrams/}}

\title{Object Design Document\\Colony Management\\(Working Title)}
\author{CIS*3760 Software Engineering\\
\\
Winter 2012\\
\\
School of Computer Science\\
University of Guelph\\
Guelph, ON, Canada\\
%%\vfill
\\
Team members:\\
Chris Allen, 0703391\\
Douglas Griffith, 0506355\\
Jameson Reed, 0666220\\
\\
Clients:\\
Jeremy Simpson, Ph.D.\\
Melissa Allwood, BSc.H
}

\date{}

\begin{document}
\maketitle
\tableofcontents
\clearpage

\section{Revision History}
\subsection*{Revision 1.0}

Initial release, 2012-03-12

\subsection*{Revision 1.1}

Second release, 2012-03-26\\

\noindent Minor updates.\\

\noindent Added subsection ``FullCalendar'' to the ``Buy vs build'' subsection of Object Design Trade-offs. 

\clearpage

\section{Preface}

This document addresss the object design of the Colony Management application. The intended audiences for this document are the developers and testers for the application.


\section{Object Design Trade-offs}

\subsection{Buy vs build}

Our team has taken advantage of many off the shelf solutions to help develop our application. The positive aspects of these solutions are that they provide various functionalities or user interfaces that we do not need to develop ourselves and can be easily implemented into the code. This speeds up development time for us but can provide problems later. One of the problems associated to premade features are that they can suffer from limited functionality and may almost but not fully perform the action the developer wishes it could do. The other problem is that the code is developed by other another team, so all the code behind the interface is obscure. Our team decided to use these free solutions: jQuery, jQuery Mobile, and PhoneGap. The rest of the software was designed by us because the functionality is too specific for and off the wall solution to provide. This also allows us to understand how our code will function.

\subsubsection{jQuery}

jQuery is designed to make the process of modifying the DOM simpler. jQuery uses a select/action command which selects a class, id, element, etc. from HTML and modifies or queries the DOM of the selected object. This provides quick and clean modifications to the HTML.

\subsubsection{jQuery Mobile}

jQuery mobile provides user interfaces and functionality designed for mobile devices. It helps the creation of an application to be more friendly to touch gestures rather than a keyboard and mouse. It also provides premade themes for the application so that it conforms to the mobile devices general theme.

\subsubsection{PhoneGap}

Phonegap cross platform deployment plugin. It allows us to design our whole application using web languages and it will then convert the web application into native code. This allows us to program from two unique mobile devices at once.

\subsubsection{FullCalendar}

FullCalendar is a robust jQuery plugin that creates a calendar with fully customizable events and functionality. It allows us to visual show dates that mice are viable for testing. We are using this plugin instead of the native calendar app because PhoneGap lacks native calendar support.   

\subsection{Memory space vs response time}

In order to untangle various parts of our code from one another, we made the decision to limit transferring of objects through various functions. In doing so, we pass the identifiers of various objects to the database and request fresh copies of the data instead. This form of uncoupling is cleaner but costs us performance due to the increase of the amount of database calls made. Calls to the database can also vary in time due to the size of the responses and the amount of calls made. 

\subsection{Retention of data vs space allocation}

Due to our application's ability to retain all data entered into it, the program will never delete any information entered and therefore will need more space as time goes on. This not a pressing concern however because the data entered takes only a very small amount of physical memory to store. It will require thousands of data entries in order to show any impact on the mobile device's memory allocation.

\subsection{Security vs functionality}

Due to our short development cycle, our team has had to make compromises when it comes to security. Security require more time than we can afford to spend on the application and therefore our rational was that the program will rely on the mobile device's built in security features. It is redundant to have not only a lock on the phone but a lock for the application itself. So we cut useless security measures in order to spend more time on the main functionality of the application. The safety of the application is completely reliant on the researchers securing their mobile devices.

\subsection{Access to data vs functionality}

Another idea we had to forgo due to time restraints was the idea of setting up a server-client relationship so that researchers could share their data with one another. Implementing a server would allow easy sharing between researchers but the development time it would take to ensure that it functions properly is more than the time available. We have decided to rely on the transmission of information through peer-to-peer channels instead.  Researchers will still have a way to share data (more limited however), and it is much easier to develop rather than a server-client relationship.

\section{Code and Documentation Standards}

In order to make our code clean and readable across the whole application, the team has decided upon using the Google JavaScript Style Guide (\url{http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml}) to conform to when developing code. The style guide also contains a Python application which check for code conformity. When it comes to documenting our application, we will be using JSDoc (\url{http://code.google.com/p/jsdoc-toolkit/}).

\section{Object Diagrams}

\begin{figure}[htb]
\centering
\includegraphics[width=\textwidth]{BoundaryControlObjectDiagram}
\caption{Boundary/Control objects diagram}
\end{figure}

\begin{figure}[htb]
\centering
\includegraphics[width=\textwidth]{Model}
\caption{Model objects diagram}
\end{figure}

\clearpage
\section{API Documentation}

The API documentation for the application has been generated using JSDoc, and is available in the pages following this one.

\subsection*{API Legend}
\begin{description}
    \item[getID()] Instance method, from constructor.
    \item[Colony\#update()] Instance method, from prototype.
    \item[Colony.list()] Static method.
\end{description}

\clearpage
\includepdf[pages=-]{jsdoc.pdf}

\clearpage
\section{Glossary}

\begin{description}
\item[BBOS ---] BlackBerry Operating System, the operating system present on modern BlackBerry Phones.
\item[Breeding Pair ---] A pair of mice designated for breeding purposes. Kept aside from the rest of the colony.
\item[Colony ---] A colony is a group of mice which will be monitored and used to breed mice fitting desired criteria for experimental use.
\item[Control Group ---] Control groups are used by experiments in order to obtain the desired mix of mice traits. An example of this would be an experiment needing a group of ten females, and another group of 8 males.
\item[Database ---] Collects and retains data used for [Application] and remains inside the phone until the deletion of the application. 
\item[DOB ---] Date of Birth.
\item[Duration ---] An amount of time after the researcher has started a mouse in the experiment before they have to check up on them at the finish.
\item[Experiment ---] A test or series thereof which the researchers would like to accomplish using the mice in their colony.
\item[Genotype ---] A classification of the mice used in creating control groups for experiments, mice genotypes are obtained by sending samples to a test lab.
\item[iOS ---] Apple's iPhone, iPad, and iPod operating system.
\item[Litter ---] A group of pups from a single birth. 
\item[Peer-To-Peer ---] Also known as P2P where devices make direct contact with one another instead of going through a medium like a file server.
\item[PhoneGap ---] A cross platform mobile development framework which allows developers to program in web languages and renders them into the native language of the device.
\item[Pup ---] A newborn mouse.
\item[Researcher ---] The person maintaining the colony and performing experiments.
\item[Research Lab ---] The location where the colonies are kept, and work with the mice is performed.
\item[Test Lab ---] Refers to to the location mice samples are sent for genotype analysis, or the room in which the colonies are kept.
\end{description}

\end{document}
